//
//  AFHttpTool.h
//  RCloud_liv_demo
//
//  Created by Liv on 14-10-22.
//  Copyright (c) 2014年 RongCloud. All rights reserved.
//


#import <Foundation/Foundation.h>

@interface AFHttpTool : NSObject

/**
 *  发送一个请求
 *
 *  @param methodType   请求方法
 *  @param url          请求路径
 *  @param params       请求参数
 *  @param success      请求成功后的回调（请将请求成功后想做的事情写到这个block中）
 *  @param failure      请求失败后的回调（请将请求失败后想做的事情写到这个block中）
 */
+(void) requestWihtMethod:(RequestMethodType)
methodType url : (NSString *)url
                   params:(NSDictionary *)params
                  success:(void (^)(id response))success
                  failure:(void (^)(NSError *err))failure;

//4.7.1.	查询好友信息列表接口 T050
+(void)getFriendListFromServerWithUid:(NSString*)uid
                                token:(NSString*)token
                             keyWords:(NSString*)keyWords
                             pageSize:(NSInteger)pageSize
                              pageNum:(NSInteger)pageNum
                              success:(void (^)(id response))success
                              failure:(void (^)(NSError* err))failure;
//4.7.2.	查询用户信息列表接口
+(void)searchFriendWithUserId:(NSString*)userId
                        token:(NSString*)token
                     nickName:(NSString*)nickName
                      pageNum:(NSInteger)pageNum
                     pageSize:(NSInteger)pageSize
                      success:(void (^)(id response))success
                      failure:(void (^)(NSError* err))failure;
//4.7.3.	添加好友申请接口 T052
+(void)requestFriend:(NSString*)userId
               token:(NSString*)token
            friendId:(NSString*)friendId
           addRemark:(NSString*)remark
             success:(void (^)(id response))success
             failure:(void (^)(NSError* err))failure;



//4.7.4.	好友申请列表接口 T053
+(void)getNewFriendListWithUid:(NSString*)uid
                         token:(NSString*)token
                       success:(void (^)(id response))success
                       failure:(void (^)(NSError* err))failure;

//4.7.5.	好友申请处理接口 T054
+(void)processRequestFriendWithFriendUid:(NSString*)friendUid
                                     uid:(NSString*)uid
                                   token:(NSString*)token
                               addStatus:(NSString*)addStatus
                                 success:(void (^)(id response))success
                                 failure:(void (^)(NSError* err))failure;

// 查询我的群组
//4.7.6.	查询我的群组列表接口 T055
+ (void)getMyGroupsByUid:(NSString *)uid
                   token:(NSString *)token
                 success:(void (^)(id response))success
                 failure:(void (^)(NSError* err))failure;
//4.7.7.	创建群组接口 T056
//创建群组
+(void)createGroupWithUid:(NSString *)uid
                    token:(NSString *)token
             groupUsersId:(NSString *)groupUsersId
                 groupImg:(NSString *)groupImg
                groupName:(NSString *)groupName
                  success:(void (^)(id response))success
                  failure:(void (^)(NSError* err))failure;
//4.7.8.	更新群信息接口 T057
//更新群信息
+ (void)updateGroupByUid:(NSString*)uid
                   token:(NSString *)token
                 groupId:(NSString *)groupId
            WithGroupImg:(NSString *)groupImg
               groupName:(NSString *)groupName
                 success:(void (^)(id response))success
                 failure:(void (^)(NSError* err))failure;

//4.7.9.	获取群详细信息接口 T058
// 获取群信息
+ (void)getGroupInfoByUid:(NSString *)uid
                    token:(NSString *)token
                  groupId:(NSString*)groupId
                  success:(void (^)(id response))success
                  failure:(void (^)(NSError* err))failure;
//4.7.10.	查询群成员列表接口 T059
// 获取群成员列表
+ (void)getGroupMemberListByUid:(NSString *)uid
                          token:(NSString *)token
                        groupId:(NSString *)groupId
                        success:(void (^)(id response))success
                        failure:(void (^)(NSError* err))failure;

//4.7.11.	群人员变动接口 T060
/// 群成员变动
+ (void)updateGroupMemberByUid:(NSString *)uid
                         token:(NSString *)token
                       groupId:(NSString *)groupId
                  withOperType:(NSString *)operType
                   groupUserId:(NSString *)groupUserId
                       success:(void (^)(id response))success
                       failure:(void (^)(NSError* err))failure;

// 4.7.12.	管理权转让接口 T061
+ (void)attornGroupMgrByUid:(NSString *)uid
                      token:(NSString *)token
                    groupId:(NSString *)groupId
              withCreateUid:(NSString *)createUid
                    success:(void (^)(id response))success
                    failure:(void (^)(NSError* err))failure;

//4.7.13.	删除好友接口 T062
+ (void)deleteFriendByUid:(NSString *)uid
                    token:(NSString *)token
                 friendId:(NSString *)friendId
                  success:(void (^)(id response))success
                  failure:(void (^)(NSError* err))failure;

//4.7.14.	注册用户查询接口 T068
//phoneNumber	电话号码	必传 多个用逗号隔开
+ (void)searchRegUsersListByUid:(NSString *)uid
                          token:(NSString *)token
                    phoneNumber:(NSString *)phoneNumber
                        success:(void (^)(id response))success
                        failure:(void (^)(NSError* err))failure;

//4.7.15.	好友申请列表清空接口 T069
// 好友申请列表清除
+ (void)cleanNewFriendsApplyListByUid:(NSString *)uid
                                token:(NSString *)token
                           userIdSets:(NSString *)userIdSets
                              success:(void (^)(id response))success
                              failure:(void (^)(NSError* err))failure;
//4.7.16.	退出群 T070
+ (void)quitGroupByUid:(NSString *)uid
                 token:(NSString *)token
               groupId:(NSString *)groupId
               success:(void (^)(id response))success
               failure:(void (^)(NSError* err))failure;



//获取好友信息
//4.2.8.	查询用户详细信息接口 T020
+(void)getUserInfoByUid:(NSString *)uid
                  token:(NSString *)token
              searchUid:(NSString *)searchUid
                success:(void (^)(id response))success
                failure:(void (^)(NSError* err))failure;

//4.1.1.	图片上传接口 T001
/*uHeadImg用户头像，
 backImg背景图片，
 photoImg摄影图片，
 trackImg迹录图片
 groupImg群头像图片
 */
+ (void)uploadImageWith:(UIImage*)img
              imgBelong:(NSString*)imgBelong
                success:(void (^)(id response))success
                failure:(void (^)(NSError* err))failure;



//4.8.1.	通知消息查询接口  T063
+ (void)getFirstNotificationByUid:(NSString *)uid
                            token:(NSString *)token
                          success:(void (^)(id response))success
                          failure:(void (^)(NSError* err))failure;
//4.8.2.	查询评论信息列表  T064
/*uid	登录用户id	必传
 token	登录用户token	必传
 msgId	消息id	选送
 */
+ (void)getCommentMsgsListByUid:(NSString *)uid
                          token:(NSString *)token
                          msgId:(NSString *)msgId
                        success:(void (^)(id response))success
                        failure:(void (^)(NSError* err))failure;
//4.1.10.	添加回复接口 T010
+ (void)addCommentByUid:(NSString *)uid
                  token:(NSString *)token
              commentId:(NSInteger)commentId
               targetId:(NSString *)targetId
            withComment:(NSString *)comment
                success:(void (^)(id response))success
                failure:(void (^)(NSError* err))failure;
//4.8.3.	查询回复信息列表
+ (void)getFcommentMsgsListByUid:(NSString *)uid
                           token:(NSString *)token
                           msgId:(NSString *)msgId
                         success:(void (^)(id response))success
                         failure:(void (^)(NSError* err))failure;
//4.8.4.	查询点赞信息列表  T066
+ (void)getLikeMsgListByUid:(NSString *)uid
                      token:(NSString *)token
                      msgId:(NSString *)msgId
                    success:(void (^)(id response))success
                    failure:(void (^)(NSError* err))failure;
//4.2.11.	查询粉丝信息列表接口 T023
+ (void)queryFansListByUid:(NSString *)uid
                     token:(NSString *)token
                  seachUid:(NSString *)seachUid
                  pageSize:(NSString *)pageSize
                   pageNum:(NSString *)pageNum
                   success:(void (^)(id response))success
                   failure:(void (^)(NSError* err))failure;

//4.2.9.	添加关注接口 T021
+ (void)addAttenByUid:(NSString *)uid
                token:(NSString *)token
         attentionUid:(NSString *)attentionUid
              success:(void (^)(id response))success
              failure:(void (^)(NSError* err))failure;
//4.2.12.	查询关注对象信息列表接口 T024
+ (void)queryAttenListByUid:(NSString *)uid
                      token:(NSString *)token
                   seachUid:(NSString *)seachUid
                   pageSize:(NSString *)pageSize
                    pageNum:(NSString *)pageNum
                    success:(void (^)(id response))success
                    failure:(void (^)(NSError* err))failure;
//4.2.10.	取消关注接口 T022
+ (void)delAttenByUid:(NSString *)uid
                token:(NSString *)token
         attentionUid:(NSString *)attentionUid
              success:(void (^)(id response))success
              failure:(void (^)(NSError* err))failure;
// 4.2.13.	查询收藏信息列表接口 T025
+ (void)queryMyCollectionByUid:(NSString *)uid
                         token:(NSString *)token
                      pageSize:(NSString *)pageSize
                       pageNum:(NSString *)pageNum
                       success:(void (^)(id response))success
                       failure:(void (^)(NSError* err))failure;
// 4.1.8.	取消收藏接口 T008
+ (void)delCollectionByUid:(NSString *)uid
                     token:(NSString *)token
                      type:(NSString *)type
                  targetId:(NSString *)targetId
                   success:(void (^)(id response))success
                   failure:(void (^)(NSError* err))failure;
//4.2.7.	更新用户信息接口 T019
+ (void)updateUserInfoByUid:(NSString *)uid
                      token:(NSString *)token
                   nickName:(NSString *)nickName
                    myCheck:(NSString *)myCheck
                 background:(NSString *)background
                    success:(void (^)(id response))success
                    failure:(void (^)(NSError* err))failure;
//4.4.7.	删除摄影动态接口 T036
+ (void)delPhotoByUid:(NSString *)uid
                token:(NSString *)token
              photoId:(NSInteger)photoId
              success:(void (^)(id response))success
              failure:(void (^)(NSError* err))failure;
//4.5.6.	删除视频动态接口 T042 wy
+ (void)delVideoByUid:(NSString *)uid
                token:(NSString *)token
              videoId:(NSInteger)videoId
              success:(void (^)(id response))success
              failure:(void (^)(NSError* err))failure;
/**
 *  4.7.17.	修改好友备注名称信息
 *
 *  @param uid          登录用户id	必传
 *  @param token        登录用户token	必传
 *  @param friendUid    好友Id	必传
 *  @param remarkName   备注名称	必传
 *  @param successBlock 回调
 */
+ (void)modifyRemarkNameWithUid:(NSString *)uid
                          token:(NSString *)token
                      friendUid:(NSString *)friendUid
                     remarkName:(NSString *)remarkName
                   successBlock:(void(^)(BOOL isSuccess, NSDictionary *resultDic))successBlock;
/**
 *  4.2.15.	位置上传接口
 *
 *  @param uid             uid
 *  @param token           token
 *  @param longitude       经度	必传
 *  @param latitude        纬度	必传
 *  @param currentLocation 通过第三方地图APP获取到的地址	必传
 *  @param successBlock    <#successBlock description#>
 */
+ (void)uploadlocationWithUid:(NSString *)uid token:(NSString *)token longitude:(NSString *)longitude latitude:(NSString *)latitude currentLocation:(NSString *)currentLocation successBlock:(void(^)(BOOL isSuccess, NSDictionary *resultDic))successBlock;


/**
 *  4.2.16.	查询聊天好友信息接口
 @param uid 用户ID
 @param token token
 @param longitude   位置
 @param latitude    地址
 @param friendUid 好友ID
 */
+ (void)queryChatFriendInfoWithUid:(NSString *)uid token:(NSString *)token longitude:(NSString *)longitude latitude:(NSString *)latitude friendUid:(NSString *)friendUid successBlock:(void(^)(BOOL isSuccess, NSDictionary *resultDic))successBlock;

@end

